import Vue from 'vue'
import Vuex from 'vuex'
import personnel from '@/pages/home/personnel/store'
import period from '@/pages/home/Repair/period/store'
import Wipe from '@/pages/home/Repair/Wipe/store'
import modify from '@/pages/home/Repair/modify/store'
import lubrication from '@/pages/home/Repair/lubrication/store'

import Orderscheduling from '@/pages/home/production/Orderscheduling/store.js' // 生产调度VUEX
import Orderentry from '@/pages/home/production/Orderentry/store' // 生产订单录入VUEX
import Processsheet from '@/pages/home/production/Processsheet/store' // 工艺单订单录入VUEX
import Certificateofconformity from '@/pages/home/production/Certificateofconformity/store' // 合格单订单录入VUEX
import Endoforder from '@/pages/home/production/Endoforder/store' // 完结单录入VUEX
Vue.use(Vuex)

const store = new Vuex.Store({
    modules:{
        personnel,
		period,
		Wipe,
		modify,
		lubrication,
		Orderscheduling,  //生产调度
		Orderentry, //生产订单录入
		Processsheet, // 工艺单订单录入VUEX
		Certificateofconformity,// 合格单订单录入VUEX
		Endoforder, // 完结单录入VUEX
    },
    state: {
        bold: uni.getStorageSync('style') || 'inherit',
		fontFamily:uni.getStorageSync('fontFamily') || "楷体",
		BackGround:uni.getStorageSync('BackGround') || "uni-bg-color-day",
		BackGroundBox:uni.getStorageSync('BackGroundBox') || "uni-bg-color-day-box",
        version:"",
		IP:uni.getStorageSync('IP') || ''
    },
    mutations: {
        setbold(state,info){
            state.bold = info
        },
		setfont(state,info) {
			state.fontFamily = info
		},
		setBackGround(state,info) {
			state.BackGround = info
		},
		setBackGroundBox(state,info) {
			state.BackGroundBox = info
		},
        setversion(state,info){
            state.version = info
        },
    },
    getters: {
        Style(state) {
            return state.bold
        },
		Font(state) {
			return state.fontFamily
		},
		BackGround(state) {
			return state.BackGround
		},
		BackGroundBox(state) {
			return state.BackGroundBox
		},
        getversion(state){
            return state.version
        },
		getIP (state) {
			return state.IP
		}	
    },
    actions: {
        mysetbold(context,info) {
            context.commit('setbold',info)
        }
    }
})

export default store